3.2.7 \(\int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\) [107]

3.2.7.1 Optimal result
3.2.7.2 Mathematica [A] (verified)
3.2.7.3 Rubi [A] (verified)
3.2.7.4 Maple [B] (verified)
3.2.7.5 Fricas [B] (verification not implemented)
3.2.7.6 Sympy [F]
3.2.7.7 Maxima [B] (verification not implemented)
3.2.7.8 Giac [F]
3.2.7.9 Mupad [B] (verification not implemented)

3.2.7.1 Optimal result

Integrand size = 23, antiderivative size = 77 \[ \int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {(a+3 b) x}{2 (a+b)^2}+\frac {b^{3/2} \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^2 d}+\frac {\cosh (c+d x) \sinh (c+d x)}{2 (a+b) d} \]

output
1/2*(a+3*b)*x/(a+b)^2+1/2*cosh(d*x+c)*sinh(d*x+c)/(a+b)/d+b^(3/2)*arctan(b 
^(1/2)*tanh(d*x+c)/a^(1/2))/(a+b)^2/d/a^(1/2)
 
3.2.7.2 Mathematica [A] (verified)

Time = 0.75 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.00 \[ \int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {2 \sqrt {a} (a+3 b) (c+d x)+4 b^{3/2} \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )+\sqrt {a} (a+b) \sinh (2 (c+d x))}{4 \sqrt {a} (a+b)^2 d} \]

input
Integrate[Cosh[c + d*x]^2/(a + b*Tanh[c + d*x]^2),x]
 
output
(2*Sqrt[a]*(a + 3*b)*(c + d*x) + 4*b^(3/2)*ArcTan[(Sqrt[b]*Tanh[c + d*x])/ 
Sqrt[a]] + Sqrt[a]*(a + b)*Sinh[2*(c + d*x)])/(4*Sqrt[a]*(a + b)^2*d)
 
3.2.7.3 Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.26, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4158, 316, 397, 218, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sec (i c+i d x)^2 \left (a-b \tan (i c+i d x)^2\right )}dx\)

\(\Big \downarrow \) 4158

\(\displaystyle \frac {\int \frac {1}{\left (1-\tanh ^2(c+d x)\right )^2 \left (b \tanh ^2(c+d x)+a\right )}d\tanh (c+d x)}{d}\)

\(\Big \downarrow \) 316

\(\displaystyle \frac {\frac {\int \frac {b \tanh ^2(c+d x)+a+2 b}{\left (1-\tanh ^2(c+d x)\right ) \left (b \tanh ^2(c+d x)+a\right )}d\tanh (c+d x)}{2 (a+b)}+\frac {\tanh (c+d x)}{2 (a+b) \left (1-\tanh ^2(c+d x)\right )}}{d}\)

\(\Big \downarrow \) 397

\(\displaystyle \frac {\frac {\frac {2 b^2 \int \frac {1}{b \tanh ^2(c+d x)+a}d\tanh (c+d x)}{a+b}+\frac {(a+3 b) \int \frac {1}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{a+b}}{2 (a+b)}+\frac {\tanh (c+d x)}{2 (a+b) \left (1-\tanh ^2(c+d x)\right )}}{d}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {\frac {(a+3 b) \int \frac {1}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{a+b}+\frac {2 b^{3/2} \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}}{2 (a+b)}+\frac {\tanh (c+d x)}{2 (a+b) \left (1-\tanh ^2(c+d x)\right )}}{d}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {\frac {\frac {2 b^{3/2} \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}+\frac {(a+3 b) \text {arctanh}(\tanh (c+d x))}{a+b}}{2 (a+b)}+\frac {\tanh (c+d x)}{2 (a+b) \left (1-\tanh ^2(c+d x)\right )}}{d}\)

input
Int[Cosh[c + d*x]^2/(a + b*Tanh[c + d*x]^2),x]
 
output
(((2*b^(3/2)*ArcTan[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a]])/(Sqrt[a]*(a + b)) + 
((a + 3*b)*ArcTanh[Tanh[c + d*x]])/(a + b))/(2*(a + b)) + Tanh[c + d*x]/(2 
*(a + b)*(1 - Tanh[c + d*x]^2)))/d
 

3.2.7.3.1 Defintions of rubi rules used

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 316
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim 
p[(-b)*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q + 1)/(2*a*(p + 1)*(b*c - a*d)) 
), x] + Simp[1/(2*a*(p + 1)*(b*c - a*d))   Int[(a + b*x^2)^(p + 1)*(c + d*x 
^2)^q*Simp[b*c + 2*(p + 1)*(b*c - a*d) + d*b*(2*(p + q + 2) + 1)*x^2, x], x 
], x] /; FreeQ[{a, b, c, d, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &&  ! 
( !IntegerQ[p] && IntegerQ[q] && LtQ[q, -1]) && IntBinomialQ[a, b, c, d, 2, 
 p, q, x]
 

rule 397
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ 
Symbol] :> Simp[(b*e - a*f)/(b*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[ 
(d*e - c*f)/(b*c - a*d)   Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e 
, f}, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4158
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ 
)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim 
p[ff/(c^(m - 1)*f)   Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)^n)^ 
p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && I 
ntegerQ[m/2] && (IntegersQ[n, p] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] 
 || EqQ[n^2, 16])
 
3.2.7.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(158\) vs. \(2(65)=130\).

Time = 1.24 (sec) , antiderivative size = 159, normalized size of antiderivative = 2.06

method result size
risch \(\frac {a x}{2 \left (a +b \right )^{2}}+\frac {3 x b}{2 \left (a +b \right )^{2}}+\frac {{\mathrm e}^{2 d x +2 c}}{8 d \left (a +b \right )}-\frac {{\mathrm e}^{-2 d x -2 c}}{8 d \left (a +b \right )}+\frac {\sqrt {-a b}\, b \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 \sqrt {-a b}+a -b}{a +b}\right )}{2 a \left (a +b \right )^{2} d}-\frac {\sqrt {-a b}\, b \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {2 \sqrt {-a b}-a +b}{a +b}\right )}{2 a \left (a +b \right )^{2} d}\) \(159\)
derivativedivides \(\frac {-\frac {1}{\left (2 a +2 b \right ) \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2}{\left (4 a +4 b \right ) \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {\left (a +3 b \right ) \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a +b \right )^{2}}+\frac {1}{\left (2 a +2 b \right ) \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {2}{\left (4 a +4 b \right ) \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-a -3 b \right ) \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 \left (a +b \right )^{2}}-\frac {2 b^{2} a \left (\frac {\left (a +\sqrt {\left (a +b \right ) b}+b \right ) \arctan \left (\frac {a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (2 \sqrt {\left (a +b \right ) b}+a +2 b \right ) a}}\right )}{2 a \sqrt {\left (a +b \right ) b}\, \sqrt {\left (2 \sqrt {\left (a +b \right ) b}+a +2 b \right ) a}}-\frac {\left (-a +\sqrt {\left (a +b \right ) b}-b \right ) \operatorname {arctanh}\left (\frac {a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (2 \sqrt {\left (a +b \right ) b}-a -2 b \right ) a}}\right )}{2 a \sqrt {\left (a +b \right ) b}\, \sqrt {\left (2 \sqrt {\left (a +b \right ) b}-a -2 b \right ) a}}\right )}{\left (a +b \right )^{2}}}{d}\) \(311\)
default \(\frac {-\frac {1}{\left (2 a +2 b \right ) \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2}{\left (4 a +4 b \right ) \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {\left (a +3 b \right ) \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a +b \right )^{2}}+\frac {1}{\left (2 a +2 b \right ) \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {2}{\left (4 a +4 b \right ) \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-a -3 b \right ) \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 \left (a +b \right )^{2}}-\frac {2 b^{2} a \left (\frac {\left (a +\sqrt {\left (a +b \right ) b}+b \right ) \arctan \left (\frac {a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (2 \sqrt {\left (a +b \right ) b}+a +2 b \right ) a}}\right )}{2 a \sqrt {\left (a +b \right ) b}\, \sqrt {\left (2 \sqrt {\left (a +b \right ) b}+a +2 b \right ) a}}-\frac {\left (-a +\sqrt {\left (a +b \right ) b}-b \right ) \operatorname {arctanh}\left (\frac {a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (2 \sqrt {\left (a +b \right ) b}-a -2 b \right ) a}}\right )}{2 a \sqrt {\left (a +b \right ) b}\, \sqrt {\left (2 \sqrt {\left (a +b \right ) b}-a -2 b \right ) a}}\right )}{\left (a +b \right )^{2}}}{d}\) \(311\)

input
int(cosh(d*x+c)^2/(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)
 
output
1/2*a*x/(a+b)^2+3/2*x/(a+b)^2*b+1/8/d/(a+b)*exp(2*d*x+2*c)-1/8/d/(a+b)*exp 
(-2*d*x-2*c)+1/2/a*(-a*b)^(1/2)*b/(a+b)^2/d*ln(exp(2*d*x+2*c)+(2*(-a*b)^(1 
/2)+a-b)/(a+b))-1/2/a*(-a*b)^(1/2)*b/(a+b)^2/d*ln(exp(2*d*x+2*c)-(2*(-a*b) 
^(1/2)-a+b)/(a+b))
 
3.2.7.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 313 vs. \(2 (65) = 130\).

Time = 0.29 (sec) , antiderivative size = 948, normalized size of antiderivative = 12.31 \[ \int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\text {Too large to display} \]

input
integrate(cosh(d*x+c)^2/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")
 
output
[1/8*(4*(a + 3*b)*d*x*cosh(d*x + c)^2 + (a + b)*cosh(d*x + c)^4 + 4*(a + b 
)*cosh(d*x + c)*sinh(d*x + c)^3 + (a + b)*sinh(d*x + c)^4 + 2*(2*(a + 3*b) 
*d*x + 3*(a + b)*cosh(d*x + c)^2)*sinh(d*x + c)^2 + 4*(b*cosh(d*x + c)^2 + 
 2*b*cosh(d*x + c)*sinh(d*x + c) + b*sinh(d*x + c)^2)*sqrt(-b/a)*log(((a^2 
 + 2*a*b + b^2)*cosh(d*x + c)^4 + 4*(a^2 + 2*a*b + b^2)*cosh(d*x + c)*sinh 
(d*x + c)^3 + (a^2 + 2*a*b + b^2)*sinh(d*x + c)^4 + 2*(a^2 - b^2)*cosh(d*x 
 + c)^2 + 2*(3*(a^2 + 2*a*b + b^2)*cosh(d*x + c)^2 + a^2 - b^2)*sinh(d*x + 
 c)^2 + a^2 - 6*a*b + b^2 + 4*((a^2 + 2*a*b + b^2)*cosh(d*x + c)^3 + (a^2 
- b^2)*cosh(d*x + c))*sinh(d*x + c) + 4*((a^2 + a*b)*cosh(d*x + c)^2 + 2*( 
a^2 + a*b)*cosh(d*x + c)*sinh(d*x + c) + (a^2 + a*b)*sinh(d*x + c)^2 + a^2 
 - a*b)*sqrt(-b/a))/((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + c)*sin 
h(d*x + c)^3 + (a + b)*sinh(d*x + c)^4 + 2*(a - b)*cosh(d*x + c)^2 + 2*(3* 
(a + b)*cosh(d*x + c)^2 + a - b)*sinh(d*x + c)^2 + 4*((a + b)*cosh(d*x + c 
)^3 + (a - b)*cosh(d*x + c))*sinh(d*x + c) + a + b)) + 4*(2*(a + 3*b)*d*x* 
cosh(d*x + c) + (a + b)*cosh(d*x + c)^3)*sinh(d*x + c) - a - b)/((a^2 + 2* 
a*b + b^2)*d*cosh(d*x + c)^2 + 2*(a^2 + 2*a*b + b^2)*d*cosh(d*x + c)*sinh( 
d*x + c) + (a^2 + 2*a*b + b^2)*d*sinh(d*x + c)^2), 1/8*(4*(a + 3*b)*d*x*co 
sh(d*x + c)^2 + (a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + c)*sinh(d*x 
 + c)^3 + (a + b)*sinh(d*x + c)^4 + 2*(2*(a + 3*b)*d*x + 3*(a + b)*cosh(d* 
x + c)^2)*sinh(d*x + c)^2 + 8*(b*cosh(d*x + c)^2 + 2*b*cosh(d*x + c)*si...
 
3.2.7.6 Sympy [F]

\[ \int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\int \frac {\cosh ^{2}{\left (c + d x \right )}}{a + b \tanh ^{2}{\left (c + d x \right )}}\, dx \]

input
integrate(cosh(d*x+c)**2/(a+b*tanh(d*x+c)**2),x)
 
output
Integral(cosh(c + d*x)**2/(a + b*tanh(c + d*x)**2), x)
 
3.2.7.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 316 vs. \(2 (65) = 130\).

Time = 0.30 (sec) , antiderivative size = 316, normalized size of antiderivative = 4.10 \[ \int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {b \log \left ({\left (a + b\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (a - b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} d} - \frac {b \log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} d} - \frac {{\left (a b - b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a b} d} + \frac {{\left (a b - b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a b} d} - \frac {b \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{2 \, \sqrt {a b} {\left (a + b\right )} d} + \frac {d x + c}{2 \, {\left (a + b\right )} d} + \frac {e^{\left (2 \, d x + 2 \, c\right )}}{8 \, {\left (a + b\right )} d} - \frac {e^{\left (-2 \, d x - 2 \, c\right )}}{8 \, {\left (a + b\right )} d} \]

input
integrate(cosh(d*x+c)^2/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")
 
output
1/4*b*log((a + b)*e^(4*d*x + 4*c) + 2*(a - b)*e^(2*d*x + 2*c) + a + b)/((a 
^2 + 2*a*b + b^2)*d) - 1/4*b*log(2*(a - b)*e^(-2*d*x - 2*c) + (a + b)*e^(- 
4*d*x - 4*c) + a + b)/((a^2 + 2*a*b + b^2)*d) - 1/4*(a*b - b^2)*arctan(1/2 
*((a + b)*e^(2*d*x + 2*c) + a - b)/sqrt(a*b))/((a^2 + 2*a*b + b^2)*sqrt(a* 
b)*d) + 1/4*(a*b - b^2)*arctan(1/2*((a + b)*e^(-2*d*x - 2*c) + a - b)/sqrt 
(a*b))/((a^2 + 2*a*b + b^2)*sqrt(a*b)*d) - 1/2*b*arctan(1/2*((a + b)*e^(-2 
*d*x - 2*c) + a - b)/sqrt(a*b))/(sqrt(a*b)*(a + b)*d) + 1/2*(d*x + c)/((a 
+ b)*d) + 1/8*e^(2*d*x + 2*c)/((a + b)*d) - 1/8*e^(-2*d*x - 2*c)/((a + b)* 
d)
 
3.2.7.8 Giac [F]

\[ \int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\int { \frac {\cosh \left (d x + c\right )^{2}}{b \tanh \left (d x + c\right )^{2} + a} \,d x } \]

input
integrate(cosh(d*x+c)^2/(a+b*tanh(d*x+c)^2),x, algorithm="giac")
 
output
sage0*x
 
3.2.7.9 Mupad [B] (verification not implemented)

Time = 2.56 (sec) , antiderivative size = 880, normalized size of antiderivative = 11.43 \[ \int \frac {\cosh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {{\mathrm {e}}^{2\,c+2\,d\,x}}{8\,d\,\left (a+b\right )}-\frac {{\mathrm {e}}^{-2\,c-2\,d\,x}}{8\,d\,\left (a+b\right )}+\frac {x\,\left (a+3\,b\right )}{2\,{\left (a+b\right )}^2}+\frac {\mathrm {atan}\left (\left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}\,\left (\frac {2\,\left (2\,b^3\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}+2\,a\,b^2\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}\right )}{d\,{\left (a+b\right )}^5\,\sqrt {b^3}\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}}-\frac {\left (a-b\right )\,\left (2\,a\,d\,{\left (b^3\right )}^{3/2}+b\,d\,{\left (b^3\right )}^{3/2}-a^4\,d\,\sqrt {b^3}-2\,a^3\,b\,d\,\sqrt {b^3}\right )}{b^2\,{\left (a+b\right )}^3\,\sqrt {a\,d^2\,{\left (a+b\right )}^4}\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}}\right )+\frac {\left (a-b\right )\,\left (4\,a\,d\,{\left (b^3\right )}^{3/2}+b\,d\,{\left (b^3\right )}^{3/2}+a^4\,d\,\sqrt {b^3}+4\,a^3\,b\,d\,\sqrt {b^3}+6\,a^2\,b^2\,d\,\sqrt {b^3}\right )}{b^2\,{\left (a+b\right )}^3\,\sqrt {a\,d^2\,{\left (a+b\right )}^4}\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}}\right )\,\left (\frac {a^4\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}}{2}+\frac {b^4\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}}{2}+3\,a^2\,b^2\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}+2\,a\,b^3\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}+2\,a^3\,b\,\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}\right )\right )\,\sqrt {b^3}}{\sqrt {a^5\,d^2+4\,a^4\,b\,d^2+6\,a^3\,b^2\,d^2+4\,a^2\,b^3\,d^2+a\,b^4\,d^2}} \]

input
int(cosh(c + d*x)^2/(a + b*tanh(c + d*x)^2),x)
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